<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ajax Post</title>
    <style>
        #result {
            width: 200px;
            height: 100px;
            border: 2px solid red;
        }
    </style>

</head>
<body>
<div id="result"></div>
<script>
    const result = document.getElementById('result')
    result.addEventListener('mouseover', event => {
        const xhr = new XMLHttpRequest()
        xhr.open('POST', 'http://localhost:8000/server')
        xhr.setRequestHeader('Content-Type', '*')
        xhr.send('a=100&b=200&c=300')
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4) {
                if (xhr.status === 200) {
                    result.innerHTML = xhr.response
                }
            }
        }
    });
</script>
</body>
</html>
